package com.muki.corpus;

import com.muki.corpus.exception.NullParseException;

/**
 * 
 * @author ljh_2017
 *
 */
public class Corpus {

	private SpiderParser parser;
	private String topic;
	
	public void sendCorpus(String topic) {
		this.topic = topic;
		parser = new MukiUriSpiderParser(topic);
	}
	
	public void parse(String context) {
		if(parser==null)
			throw new NullParseException();
		parser.parse(context);
	}
	
	public void parse(String context,String regx) {
		parse(context);
		RegularCore.put(topic, regx);	
	}
}
